package com.training.admin.service;

import java.util.List;

import com.demo2do.core.entity.page.Page;
import com.training.admin.entity.principal.Principal;
import com.training.admin.entity.security.Login;

/**
 * 
 * @author dan
 *
 */
public interface PrincipalService extends DataService<Principal> {
    
    /**
     * 
     * @param login
     * @return
     */
    public int count(Login login);
    
    /**
     * 
     * @param login
     * @param page
     * @return
     */
    public List<Principal> list(Login login, Page page);

    /**
     * 
     * @param name
     * @return
     */
    public Principal loadByName(String username);

    /**
     * 
     * @param name
     * @return
     */
    public Principal loadByEmail(String username);

    /**
     * 
     * @param principal
     */
    public void create(Principal principal);
    
    /**
     * 
     * @param principal
     * @param password
     * @param operator
     */
    public void resetPassword(Principal principal, String password) ;

}
